package routers

import (
	v1 "blog/api/v1"
	"blog/middleware"
	"github.com/gin-gonic/gin"
)

func InitArticleRouter(Router *gin.RouterGroup) {
	articleRouter := Router.Group("")
	articleRouter.Use(middleware.JwtToken())
	{
		//文章模块
		articleRouter.POST("article/add", v1.AddArticle)
		articleRouter.PUT("article/:id", v1.EditArticle)
		articleRouter.DELETE("article/:id", v1.DeleteArticle)
	}
	router := Router.Group("")
	{
		router.GET("articles", v1.GetArticles)
		router.GET("article/info/:id", v1.GetArticleInfo)
		router.GET("article/list/:id", v1.GetCategoryArticles)
	}
}
